//package com.xyh.transaction.config;
//
//import org.springframework.context.annotation.Configuration;
//import org.springframework.messaging.simp.config.MessageBrokerRegistry;
//import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
//import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
//import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;
//
//@Configuration
//@EnableWebSocketMessageBroker
//public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
//
//    @Override
//    public void configureMessageBroker(MessageBrokerRegistry config) {
//        // 配置消息代理
//        config.enableSimpleBroker("/topic");
//        config.setApplicationDestinationPrefixes("/app");
//    }
//
//    @Override
//    public void registerStompEndpoints(StompEndpointRegistry registry) {
//        // 注册 WebSocket 端点
//        registry.addEndpoint("/ws")
//                .setAllowedOrigins(
//                        "http://124.223.56.87:81",
//                        "http://124.223.56.87:82",
//                        "http://localhost:5173",
//                        "http://localhost:8848"
//                )  // 允许特定来源
//                .withSockJS();
//    }
//}
